import { defineStore } from 'pinia';
import { ref } from 'vue';

interface SystemSettings {
  name: string;
  description: string;
  logo: string;
  theme: 'default' | 'dark' | 'blue';
  language: 'zh-CN' | 'en-US';
}

export const useSystemStore = defineStore('system', () => {
  const systemSettings = ref<SystemSettings>({
    name: '',
    description: '',
    logo: '',
    theme: 'default',
    language: 'zh-CN'
  });

  const fetchSystemSettings = async (): Promise<SystemSettings> => {
    // TODO: 实现从后端获取系统设置的逻辑
    return systemSettings.value;
  };

  const updateSystemSettings = async (settings: Partial<SystemSettings>) => {
    // TODO: 实现更新系统设置的逻辑
    Object.assign(systemSettings.value, settings);
  };

  return {
    systemSettings,
    fetchSystemSettings,
    updateSystemSettings
  };
}); 